impl Solution1 {

  pub fn is_unique(astr: String) -> bool {
    let len: usize = astr.len();

    if len <= 1 {
      return true;
    }

    if len > 128 {
      return false;
    }

    let mut charset: [bool; 128] = [false; 128];
    let astr_bytes: &[u8] = astr.as_bytes();

    for i in 0..len {
      let val: usize = astr_bytes[i] as usize;

      if charset[val] {
        return false;
      }

      charset[val] = true;
    }

    return true;
  }

}